package cn.edu.njuit.springbootfilmreview.dto;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

/**
 * 
 * @TableName movie_awards
 */
@Data
public class MovieAwards implements Serializable {
    /**
     * 
     */
    @TableId
    private Long awardId;

    /**
     * 奖项名称
     */
    private String awardName;

    /**
     * 获奖年份
     */
    private Integer festivalYear;

    /**
     * 获奖人姓名，多个用逗号隔开
     */
    private String persons;

    /**
     * 获奖类型：提名、得奖
     */
    private String awardType;

    /**
     * 关联电影节
     */
    private Long festivalId;

    /**
     * 关联电影
     */
    private Long movieId;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        MovieAwards other = (MovieAwards) that;
        return (this.getAwardId() == null ? other.getAwardId() == null : this.getAwardId().equals(other.getAwardId()))
            && (this.getAwardName() == null ? other.getAwardName() == null : this.getAwardName().equals(other.getAwardName()))
            && (this.getFestivalYear() == null ? other.getFestivalYear() == null : this.getFestivalYear().equals(other.getFestivalYear()))
            && (this.getPersons() == null ? other.getPersons() == null : this.getPersons().equals(other.getPersons()))
            && (this.getAwardType() == null ? other.getAwardType() == null : this.getAwardType().equals(other.getAwardType()))
            && (this.getFestivalId() == null ? other.getFestivalId() == null : this.getFestivalId().equals(other.getFestivalId()))
            && (this.getMovieId() == null ? other.getMovieId() == null : this.getMovieId().equals(other.getMovieId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getAwardId() == null) ? 0 : getAwardId().hashCode());
        result = prime * result + ((getAwardName() == null) ? 0 : getAwardName().hashCode());
        result = prime * result + ((getFestivalYear() == null) ? 0 : getFestivalYear().hashCode());
        result = prime * result + ((getPersons() == null) ? 0 : getPersons().hashCode());
        result = prime * result + ((getAwardType() == null) ? 0 : getAwardType().hashCode());
        result = prime * result + ((getFestivalId() == null) ? 0 : getFestivalId().hashCode());
        result = prime * result + ((getMovieId() == null) ? 0 : getMovieId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", awardId=").append(awardId);
        sb.append(", awardName=").append(awardName);
        sb.append(", festivalYear=").append(festivalYear);
        sb.append(", persons=").append(persons);
        sb.append(", awardType=").append(awardType);
        sb.append(", festivalId=").append(festivalId);
        sb.append(", movieId=").append(movieId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}